pygtk OSError: [Errno 2] No such file or directory. subprocess.Popen PIPE command
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Traceback (most recent call last):
File "./search.py", line 18, in search_entry
self.s1 = subprocess.Popen(['find /home/bludiescript/tv-shows', '-type f', '-name "*.mkv"'], shell=False, stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
thanks also find was part of the dir location i noticed. it stopped producing the error but now it seems like its only searching in the second find or s2 rather. i added print "%s" % self.list at the end of the search_entry to see if it just added the result to the list like i wanted but it didnt
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810
Rep:
Personally I always have trouble with subprocess arguments and recommend using the shlex module to split argument lists up - it makes things much easier of less prone to errors. It's even mentioned in the python standard documentation for python's subprocess module.
so i decided to try os.walk shlex kind of confused me and wasnt sure how to implement it with my code.
my code now
top = '/home/bludiescript/tv-shows'
for dirpath, dirnames, filenames in os.walk(top):
for filename in filenames:
print os.path.join(dirname, filename)
so now rather than getting zero results with find i get all the files in the directories below the specified dir is their a way that i can say link a get_text to os.walk so it will search the directory for the file i type in the text field
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.